package com.unisal.java;

public class Garconete {

	MenuPanquecasDaCasa menuDePanquecas;
	MenuJantar menuJantar;

	public Garconete(MenuPanquecasDaCasa menuDePanquecas, MenuJantar menuJantar) {
		this.menuDePanquecas = menuDePanquecas;
		this.menuJantar = menuJantar;
	}
	
	public void imprimeMenu(){
		Iterator paquecaIterator = menuDePanquecas.createIterator();
		Iterator jantarIterator = menuJantar.createIterator();
		
		System.out.println("MENU\n----\nCafe da Manha");
		printMenu(paquecaIterator);
		
		System.out.println("MENU\n----\nJantar");
		printMenu(jantarIterator);
	}

	private void printMenu(Iterator iterator) {
		while(iterator.hasNext()){
			ItemDoMenu item = (ItemDoMenu) iterator.next();
			System.out.print(item.getNome() + " ");
			System.out.print(item.getPreco() + " ");
			System.out.println(item.getDescricao());
		}
		
	}
}
